//
//  UINavigationBar_Ht.m
//  WZLProduct
//
//  Created by dllo on 16/3/18.
//  Copyright © 2016年 HaiTeng. All rights reserved.
//

#import "UINavigationBar_Ht.h"

@implementation UINavigationBar_Ht

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor colorWithRed:0.29 green:0.74 blue:0.8 alpha:1];
        self.frame = CGRectMake(0, 0, kScreenWidth, 64);


        
        [self creatSubViews];
    }
    return self;
}

/** 创建所有视图 */
- (void)creatSubViews{
 

}



- (UITextField *)titleTextFile{
    if (!_titleTextFile) {
        self.titleTextFile = [[UITextField alloc] initWithFrame:CGRectMake(10, 20, self.width - 10 - 90, 35)];
        [self addSubview:_titleTextFile];
    }
    return _titleTextFile;
}

- (UIButton *)rightBarButton{
    if (!_rightBarButton) {
        self.rightBarButton = [UIButton buttonWithType:UIButtonTypeSystem];
        _rightBarButton.frame = CGRectMake(self.width - 90, 20, 80, 35);
        [self addSubview:_rightBarButton];
    }
    return _rightBarButton;
}

- (UIButton *)leftBarButton{
    if (!_leftBarButton) {
        self.leftBarButton = [UIButton buttonWithType:UIButtonTypeSystem];
        [self addSubview:_leftBarButton];
        [_leftBarButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self).with.offset(20);
            make.left.equalTo(self);
            make.bottom.equalTo(self);
            make.width.mas_equalTo(35);
        }];
    }
    return _leftBarButton;
}

- (UILabel *)title{
    if (!_title) {
        self.title = [[UILabel alloc] init];
        [self addSubview:_title];
        _title.textAlignment = NSTextAlignmentCenter;
        _title.font = [UIFont systemFontOfSize:25];
        _title.textColor = [UIColor whiteColor];
       [_title mas_makeConstraints:^(MASConstraintMaker *make) {
  
           make.left.equalTo(self).with.offset(35);
           make.right.equalTo(self).with.offset(-70);
           make.top.equalTo(self).with.offset(20);
           make.bottom.equalTo(self);
           
       }];
        
    }
    return _title;
}

- (UIButton *)rightBarFistButton{
    if (!_rightBarFistButton) {
        self.rightBarFistButton = [[UIButton alloc] init];
        [self addSubview:_rightBarFistButton];
        [_rightBarFistButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).with.offset(-70);
            make.top.equalTo(self).with.offset(20);
            make.bottom.equalTo(self);
            make.width.mas_equalTo(35);
        }];
        
    }
    return _rightBarFistButton;
}




@end
